package edu.ynu.se.xiecheng.achitectureclass.controller;

import edu.ynu.se.xiecheng.achitectureclass.common.controller.LogicController;
import edu.ynu.se.xiecheng.achitectureclass.dao.BusinessDao;
import edu.ynu.se.xiecheng.achitectureclass.dao.UserDao;
import edu.ynu.se.xiecheng.achitectureclass.entity.Business;
import edu.ynu.se.xiecheng.achitectureclass.entity.Item;
import edu.ynu.se.xiecheng.achitectureclass.entity.User;

import edu.ynu.se.xiecheng.achitectureclass.service.BusinessService;
import edu.ynu.se.xiecheng.achitectureclass.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;

@RestController
@RequestMapping("/User")
@Validated
public class UserController extends LogicController<UserService, UserDao, User,Long> {
    public UserController(@Autowired UserService service) {
        super(service);
    }
    @Autowired
    private UserService userService;
    @PostMapping("/login")
    public String createShopItem(String username, String password) {
        return userService.login(username, password);
    }
    @GetMapping("/hello")
    public String hello() {
        return "hello";
    }
}
